import {Routes, RouterModule} from "@angular/router";
import {HeroesComponent} from "./heroes.component";
import {HeroDetailComponent} from "./hero-detail.component";

const crisisCenterRoutes: Routes = [
  {path: '', redirectTo: '/crisis-center', pathMatch: 'full'},
  {
    path: 'crisis-center',
    loadChildren: 'app/crisis-center/crisis-center.module#CrisisCenterModule'
  }
]

const appRoutes: Routes = [
  ...crisisCenterRoutes,
  {
    path: 'heroes',
    component: HeroesComponent,
    data: {
      title: 'Heroes List'
    }
  },
  {path: 'detail/:id', component: HeroDetailComponent},
  {path: 'hero/:id', component: HeroDetailComponent}
]

export const appRoutingProviders: any[] = []

export const routing = RouterModule.forRoot(appRoutes)